﻿<phone:PhoneApplicationPage 
    x:Class="SpeedRun.Runner"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:pivot="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="CornflowerBlue"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
     shell:SystemTray.ForegroundColor="CornflowerBlue"
    shell:SystemTray.IsVisible="True">

    <ScrollViewer>
    <Grid x:Name="LayoutRoot" Background="Black" VerticalAlignment="Bottom">
        <Grid  x:Name="runningOn" Background="Black" VerticalAlignment="Bottom" Visibility="Visible" Height="700">
            <StackPanel Margin="0,0,0,0" >
                <pivot:Pivot Height="300" Foreground="CornflowerBlue">
                    <pivot:PivotItem Header="Time" FontSize="20">
                        <TextBlock Text="0 sec" FontSize="90" TextAlignment="Center" HorizontalAlignment="Center" Name="time"  VerticalAlignment="Top" Width="480" OpacityMask="#FF6C5050" Padding="1" />
                    </pivot:PivotItem>
                    <pivot:PivotItem Header="Speed" FontSize="20">
                        <TextBlock FontSize="90" TextAlignment="Center" HorizontalAlignment="Center" Name="currentSpeed" Text="0 mph" VerticalAlignment="Top" Width="480" OpacityMask="#FF6C5050" Padding="1" />
                    </pivot:PivotItem>
                    <pivot:PivotItem Header="Distance" FontSize="20" Foreground="Green">
                        <TextBlock FontSize="90" TextAlignment="Center" HorizontalAlignment="Center" Name="Distance" Text="0 m" VerticalAlignment="Top" Width="480" OpacityMask="#FF6C5050" Padding="1" />
                    </pivot:PivotItem>
                    
                    <pivot:PivotItem Header="Calories" FontSize="20" Foreground="Red">
                        <TextBlock FontSize="90" TextAlignment="Center" HorizontalAlignment="Center" Name="calories" Text="0 cal" VerticalAlignment="Top" Width="480" OpacityMask="#FF6C5050" Padding="1" />
                    </pivot:PivotItem>

                        <pivot:PivotItem Header="Summary" Foreground="CornflowerBlue">
                            <ScrollViewer>
                            <StackPanel>
                                <TextBlock Text="{Binding ElementName=currentSpeed, Path=Text}" FontSize="30" />
                                    <TextBlock Text="{Binding ElementName=Distance, Path=Text}" FontSize="30"  />
                                <TextBlock Text="{Binding ElementName=time, Path=Text}" FontSize="30"  />
                                <TextBlock Text="{Binding ElementName=calories, Path=Text}" FontSize="30"  />
                            </StackPanel>
                            </ScrollViewer>
                        </pivot:PivotItem>
                    </pivot:Pivot>
               <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                        <Border Background="CornflowerBlue" Height="95"  Margin="10">
                            <Image Hold="Image_Hold_1" Tap="rr_Tap" Source="Images/appbar.control.rewind.png" Width="75" Height="75" Margin="10" />
                        </Border>
                        <Border Opacity="0.85"  Visibility="Collapsed" BorderThickness="10" x:Name="Stop" Background="Red">
                        <Image x:Name="stopImg" Visibility="Visible" Tap="Image_Tap" Source="Images/appbar.control.stop.png" Width="165" Height="165" Margin="10" ImageFailed="Image_ImageFailed">
                        </Image>
                    </Border>
                    <Border BorderBrush="Transparent"  x:Name="playImage" Visibility="Visible" Background="CornflowerBlue" BorderThickness="10">
                        <Image Tap="Image_Tap" Source="Images/appbar.transport.play.rest.png" Width="150" Height="150" Margin="10">
                            <Image.RenderTransform>
                                <CompositeTransform x:Name="transform" />
                            </Image.RenderTransform>
                        </Image>
                    </Border>
                        <Border Background="CornflowerBlue" Height="95"  Margin="10">
                        <Image Hold="Image_Hold" Tap="ff_Tap" Source="Images/appbar.control.fastforward.png" Width="75" Height="75" Margin="10" />
                        </Border>
                    </StackPanel>
                    <ScrollViewer Height="100">
                        
                            <StackPanel>
                                <TextBlock Name="songName" TextAlignment="Center" TextWrapping="Wrap" />
                                <TextBlock Text="" x:Name="programInfo" />
                                <Button Foreground="CornflowerBlue" BorderBrush="CornflowerBlue"  Content="Songs" Click="Button_Click_1" Width="250" />
                                <Button Foreground="CornflowerBlue" BorderBrush="CornflowerBlue"  Content="Settings" Click="Button_Click" Width="250" />
                            </StackPanel>
                      
                    </ScrollViewer>
                </StackPanel>
        </Grid>
        <TextBlock Name="statusMsg" Text="Status" Margin="402,82,0,659" TextAlignment="Center" />
        <TextBlock Height="50" Name="currentLocation" Text="Coordinates" Width="480" VerticalAlignment="Bottom" TextAlignment="Center" />
         <Grid Visibility="Collapsed" x:Name="summary" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="Black" Opacity="1" >
            <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="AverageSpeed : "  FontSize="28" />
                <TextBlock Name="avgSpeed"  FontSize="28" />
            </StackPanel>
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="Disance : "  FontSize="28" />
                <TextBlock Name="distance"  FontSize="28" />
            </StackPanel>
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="Calories : "  FontSize="28" />
                <TextBlock Name="cal"  FontSize="28" />
            </StackPanel>
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="Maximum Speed : "  FontSize="28" />
                <TextBlock Name="maxSpeed"  FontSize="28"  />
            </StackPanel>
                <TextBlock x:Name="Comments"   FontSize="28" TextWrapping="Wrap" />
            </StackPanel>
        </Grid>

        <ProgressBar Foreground="CornflowerBlue" IsIndeterminate="True" Visibility="Collapsed" VerticalAlignment="Top" Height="10" x:Name="progressBar" />
        <Canvas  Width="75" Height="75" Margin="0,3,3,0" HorizontalAlignment="Right" VerticalAlignment="Top" >
            <Ellipse Tap="indicator_Tap" Height="45" Width="45" Canvas.Left="15" x:Name="indicator" Canvas.Top="15" Fill="Red" VerticalAlignment="Center" HorizontalAlignment="Center" />
        </Canvas >
            <TextBlock Height="108" HorizontalAlignment="Left" Margin="3,1,0,0" Name="textBlock1" FontSize="77" Text="Speed Run" VerticalAlignment="Top" Width="408" />
        </Grid>
    </ScrollViewer>
 
    <!--Sample code showing usage of ApplicationBar-->
    <!--<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="MenuItem 1"/>
                <shell:ApplicationBarMenuItem Text="MenuItem 2"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>-->

</phone:PhoneApplicationPage>
